home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-09 | 3.7 KB | 113 lines | [TEXT/MPCC] |
- // ----------------------------------------------------------------------------------
- // SpellWright.h
- // ----------------------------------------------------------------------------------
- // Header File for SpellWright Spelling Checker Library
- //
- // Copyright 1994 LexTek International
- // 2255 N. University Parkway, Suite 15
- // Provo, UT 84604
- // (801) 375.8332 (801) 377.7654 (fax)
-
- #ifndef _SPELLWRIGHT_
- #define _SPELLWRIGHT_
-
- #include <Files.h>
-
- #ifndef FioParam
- #define FioParam FSSpec
- #endif
-
- typedef struct {
- short Case;
- short Duplicate;
- short Replace;
- } WordInfo;
-
- typedef void *SWChecker;
-
- // ----------------------------------------------------------------------------------
- // Dicionary Constants
- // ----------------------------------------------------------------------------------
-
-
- #define AUTO_DICT (1)
- #define SUGGEST_DICT (2)
- #define DOCUMENT_DICT (4)
- #define SKIP_DICT (8)
- #define USER_DICT (16)
- #define MAIN_DICT (32)
-
- #define IS_SPELLED_CORRECTLY (1)
- #define IS_NOT_SPELLED_CORRECTLY (0)
-
- #define UPPER_UPPER_lower (1)
- #define lower_UPPER_lower (2)
- #define lower_UPPER_UPPER (3)
- #define lower_lower_UPPER (4)
- #define lower_UPPER (5)
- #define lower_case (6)
- #define UPPER_CASE (7)
- #define UPPER_lower (8)
-
- #define WORD_DUPLICATED (1)
- #define WORD_NOT_DUPLICATED (0)
-
- #define FOUND 1 // Found word in search
- #define NOTFOUND 0 // Didn't find word in search
-
-
- // ----------------------------------------------------------------------------------
- // Spell Error Codes
- // ----------------------------------------------------------------------------------
-
- #define eNo_Err (0)
- #define eNo_Mem (-1)
- #define eOpening_File (-2)
- #define eNot_Dictionary (-3)
- #define eUser_Dict_Corrupted (-4)
- #define eNot_Done (-5)
- #define eDone (-6)
- #define eGeneral (-7)
- #define eReading_File (-8)
- #define eWriting_File (-9)
- #define eUnusableDict (-10)
- #define eNotSpeller (-11)
- #define eIllegalCmd (-12)
-
-
-
- // ----------------------------------------------------------------------------------
- // Functions
- // ----------------------------------------------------------------------------------
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- extern SWChecker StartSpellCheckSession();
- extern void EndSpellCheckSession(SWChecker Speller);
- extern short DictOpen(SWChecker Speller, unsigned long *DictNum, short DictType,
- long Size, FioParam *theFile);
- extern void DictClose(SWChecker Speller, unsigned long DictNum);
- extern short Select(SWChecker Speller, char *Word);
- extern short CheckWord(SWChecker Speller, unsigned long DictNum,short DictType,
- char *Word, WordInfo *Info);
- extern short FindFirstSuggestion(SWChecker Speller, unsigned long DictNum, short DictType,
- char *Word, char *Suggestion, char *Comment, short *AutoReplace);
- extern short FindNextSuggestion(SWChecker Speller, unsigned long DictNum, short DictType,
- char *Word, char *Suggestion, char *Comment, short *AutoReplace);
- extern short AddToDictionary(SWChecker Speller, unsigned long DictNum, char *Word,
- char *Suggestion, char *Comment);
- extern short FindFirstRegex(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
- extern short FindNextRegex(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
- extern short LocateWord(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
- extern short NextWord(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
- extern short CurrentWord(SWChecker Speller, unsigned long DictNum, short DictType, char *Word);
- extern short GetSpellError();
- extern void FixCase(SWChecker Speller, char *Word, short CaseCode);
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif